<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
  <cpn ref="a"></cpn>
  <button @click="btnclick">按钮</button>
</div>
<template id="cpn">
  <div>
    <h2>我是子组件</h2>
  </div>
</template>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el:'#app',
    data:{
      message:'123'
    },
    methods:{
      btnclick() {
        console.log(this.$children),
        console.log(this.$refs)
      }
    },
    components:{
      cpn:{
        template:`#cpn`,
        methods: {
          show(){
            console.log('show');
          }
        }
      }
    }
  })
</script>
</body>
</html>